<script setup>
import Sidebar from './components/Sidebar.vue'
import { useRoute } from 'vue-router'
import { computed } from 'vue'

const route = useRoute()
const isLoginPage = computed(() => route.path === '/login')
</script>

<template>
  <div class="app">
    <Sidebar v-if="!isLoginPage" />
    <main :class="{ 'main-content': !isLoginPage, 'full-content': isLoginPage }">
      <router-view></router-view>
    </main>
  </div>
</template>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
}

#app {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.scrollable {
    overflow: auto; /* 允许内容溢出时显示滚动条 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}
 
/* 对于Webkit浏览器（如Chrome和Safari） */
.scrollable::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera*/
}

.app {
  min-height: 100vh;
  background-color: #f5f5f5;
  display: flex;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  height: 100vh;
  background-image: url("../src/assets/bigbg.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
    scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* Internet Explorer 10+ */
}

.full-content {
  flex: 1;
  overflow-y: auto;
  height: 100vh;
}
</style>`